package com.tyk.bookstore.back.system.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tyk.bookstore.back.common.core.model.type.Gender;
import com.tyk.bookstore.back.system.model.type.UserState;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author tyk
 * @description 用户
 */
@Schema(name = "UserDo", description = "用户")
@Data
@TableName("user")
public class UserDo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;


    @Schema(description = "ID")
    @TableId(value = "id")
    private Long id;

    @Schema(description = "账号")
    @TableField("account")
    private String account;

    @Schema(description = "密码")
    @TableField("password")
    private String password;

    @Schema(description = "手机号")
    @TableField("phone")
    private String phone;

    @Schema(description = "邮箱")
    @TableField("email")
    private String email;

    @Schema(description = "状态[0可用,1禁用,2注销]")
    @TableField("state")
    private UserState state;

    @Schema(description = "是否为超级管理员")
    @TableField("root")
    private Boolean root;

    @Schema(description = "姓名")
    @TableField("name")
    private String name;

    @Schema(description = "性别[0男,1女]")
    @TableField("gender")
    private Gender gender;

    @Schema(description = "年龄")
    @TableField("age")
    private Byte age;

    @Schema(description = "身份证号")
    @TableField("id_card")
    private String idCard;

    @Schema(description = "头像")
    @TableField("avatar")
    private String avatar;

    @Schema(description = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;
}
